package fun.werfamily.wf.order.core.domain.remote.service;

import fun.werfamily.wf.base.vo.Result;
import fun.werfamily.wf.base.constant.ServiceConstant;
import fun.werfamily.wf.order.core.domain.remote.dto.PayCancelReq;
import fun.werfamily.wf.order.core.domain.remote.dto.PayCancelSuccessRespDTO;
import fun.werfamily.wf.order.core.domain.remote.dto.PayCreateReq;
import fun.werfamily.wf.order.core.domain.remote.dto.PaySuccessRespDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: Mr.WenMing Zhang
 * @Date: 2022-08-28 12:28
 * @Description:
 */
@FeignClient(name = ServiceConstant.PAYMENT_CORE_NAME, path = ServiceConstant.PAYMENT_CORE_PATH)
public interface PaymentRemoteService {

    /**
     * 创建支付单
     * @param req
     * @return
     */
    @PostMapping("/pay/create")
    Result<PaySuccessRespDTO> createPay(@RequestBody PayCreateReq req);

    /**
     * 取消支付
     * @param req
     * @return
     */
    @PostMapping("/pay/cancel")
    Result<PayCancelSuccessRespDTO> cancelPay(@RequestBody PayCancelReq req);
}
